home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
HENSA
/
SCREENSAVER
/
LINEZ.ZIP
/
!Linez
/
!Help
next >
Wrap
Text File
|
1998-03-20
|
10KB
|
191 lines
> !Linez.!Help
LINEZ - A USER-CONFIGURABLE DESKTOP SCREENSAVER
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INTRODUCTION
Linez is a desktop front-ended screensaver which bounces lines around the
screen, fading them from one colour to another. The lines can either be
straight or curved (bezier) and for speed the screensaver code itself is
written in pure ARM assembler. This program requires 32k to execute.
This screensaver does not, however, work with the RISC OS screenblanker
utility so this should be turned off. Also, in multitasking mode, naughty
programs that use direct screen access without checking for screen output
disabling, like Zap's flashing cursor or an active taskwindow, can cause
wierd little bits to appear on the screen in odd places.
The basics are that clicking SELECT on the application on the iconbar icon
opens the configuration window (which should be self-explanatory) and ADJUST
starts the sceensaver (which has a default delay time of 30 seconds). Another
way to start the screensaver is to move the mouse to the top-left corner of
the screen and wait for 3 seconds. By default the screensaver runs in the
current desktop mode. Move the mouse or press SHIFT to return to the desktop.
NEW - Also responds to !CallerID.
Things can get REALLY fun when you have say five copies of the screensaver
multitasking together - they will all start at the same time! For best
results don't use reflection when using multiple copies.
LICENCE
This program is FREEWARE so may be used by all and distributed freely
between individuals and by PD libraries and ftp/bbs etc. as long as this is
not done for profit and the application remains complete and unaltered.
DETAILED INSTRUCTIONS
Double-click on the !Linez icon in the filer window (why I am bothering to
say this I have no idea...) and the program will install itself on the icon
bar, unless of course you've get the hide icon option set. If you always want
to have multiple copies loaded up then change the !Run file to include the
correct number of Filer_Run's.
Clicking MENU on the icon bar icon brings up a menu with five entries: Info,
Start, Configure, Help ..., Quit. Info leads to an information box thingy
(yes I know 'Totally amazing screensaver' sounds really pretentious but no
one takes these purpose fields seriously anyway). Start is identical to
an ADJUST click on the icon bar icon, Configure to a SELECT click. Help ...
loads this particular file into the nearest friendly text editor. Quit
terminates execution of the proggy (not that you'd want to do that).
NEW - Hold down Alt as you quit from icon bar menu or Task Manager to close
all copies.
SELECT opens the configuration window as mentioned before. The option sets
are described below:
Screensaver Options - The screensaver can run in the current desktop mode or
be given an alternative. Mode number allows RISC OS 3.1 users to specify a
mode number; a 256 colour one is preferable like mode 15 (CGA) or mode 28
(VGA). Mode string allows RISC OS 3.5+ users to specify resolution and colour
depth exactly (it doesn't work on RISC OS 3.1 so don't bother to try). If the
mode number is unavailable/invalid then the current desktop mode is used. The
visible advantage of 32K colours over 256 is small and of 16M over 32K even
less! Incidentally, a CMYK palette is used in a 4 colour mode which looks
better than RGB IMHO, and a custom one used in a 16 colour mode. It is
possible to set whether the screensaver multitasks while operating; this can
slow the screensaver down especially if file operations are going on while
it's trying to draw lines all over the screen. If multiple copies are loaded
then only ones with the multitasking option set will start up. Whether or not
an icon is put on the icon bar can be set for those of you who don't like
getting cluttered. If you hold down one of the Alt keys while the program is
loading you get an icon there anyway. The sleep/no-sleep corners work by
checking if the pointer is at the top-left or top-right of the screen and
starting or disabling the screensaver accordingly. These can be turned on or
off.
Time Delay - This sets how long a period of desktop inactivity is required to
trigger the screensaver. Any value from one second to an hour (3600 seconds)
can be entered in the custom box if you don't like the presets.
Linez - This option sets whether straight or bezier lines are used, and the
quality of the bezier lines. The number 2 raised to the power quality is how
many straight lines make up the bezier curve - with quality 5 there are 32
for example. The delay between lines is measured in centiseconds. If the
lines take longer to draw than the delay then this delay time is ignored.
Reflection - The points for one line only are calculated but these can be
mirrored to produce interesting effects. Reflect diagonally means in the line
y=-x. Reflect three ways means this and in the x- and y-axes.
Movement - This provides the most room for experimentation! Maximum velocity
is measured in OS units per second (a VGA screen is 1280 by 960 OS units) and
maximum acceleration in 1/16ths of an OS unit per second squared (!) Colour
fading is based on an RGB colour cube: intensities 64-255 are used for the
red, green and blue components. Acc change every and Fade change every is the
average number of lines between a change in the acceleration or fading rate.
The Demo button allows you to view the effects of any changes without
storing them and Cancel will reset any values you have not OK'd. OK and Save
both store the changes, but as you might expect Save creates a file called
Config inside the application ready for when you reload. Click ADJUST on any
of these buttons and the window stays open.
If you click ADJUST on the iconbar icon the screensaver is started
immediately but unlike pressing Demo any un-OK'd changes are not taken into
account. It in effect shortens the delay time to zero. Any movement of the
mouse or keypress will return you to the desktop, however I recommend you
move mouse or press SHIFT in multitasking mode so you don't end up typing in
stuff where you didn't want it.
A FEW IDEAS
Here are a few values to give you a few ideas for experimenting with. They
were obtained using MODE 28, delay time of 4 and bezier line quality of 5 in
singletasking mode on my trusty A3010.
*-----------------------------------------------------------------------*
| Type of line | STRAIGHT | BEZIER |
|-------------------+-------------------------+-------------------------|
| Number of lines | 25 | 50 | 35 | 40 | 70 | 10 | 20 | 15 |
| Reflection | all | none | x | y=-x | none | y | y=-x | all |
| Max velocity | 16 | 32 | 24 | 20 | 16 | 64 | 28 | 20 |
| Max acceleration | 32 | 4 | 8 | 0 | 2 | 16 | 8 | 4 |
| Max fade | 32 | 8 | 20 | 12 | 4 | 64 | 24 | 20 |
| Acc change every | 50 | 100 | 200 | 500 | 100 | 10 | 160 | 15 |
| Fade change every | 100 | 250 | 75 | 120 | 50 | 50 | 80 | 60 |
*-----------------------------------------------------------------------*
HOW IT WORKS
Each straight line requires two reference points (each end in other words)
and each bezier curve needs four. Each point has both an x and y position,
velocity and acceleration. Every frame, the velocities are added to the
positions and the accelerations to the velocities. The illusion of movement
is given by blanking out one of the previous lines leaving the correct
number still on screen. The colour is stored as 24-bit RGB with the red,
green and blue elements changing at a constant rate. The colour change rates
and accelerations are changed to new random values every so often. The
centre of the screen is set to be the origin so reflection is simply done by
changing the sign of the x, y or both co-ordinates and drawing the
line/curve again. The colour is set using the ColourTrans module to pick the
closest match and dithering is used. This program uses an unallocated wimp
message &C4C5A in multiple copies mode.
SPEED IMPROVEMENTS (ARM2/250)
The calls to the operating system to draw the lines can be made MUCH faster
on RISC OS 3.1 by speeding up the ROM's. To do this you need to type
SYS "OS_UpdateMEMC",160,240 at the BASIC prompt (or create a BASIC program
and run it). *RMFaster ColourTrans may have some effect. Alternatively, to
increase speed try using less reflection and lower bezier line quality and
not trying to multitask 99 copies together - or buy a RiscPC!
THE AUTHOR
A humble penniless physics student slaving away over his Arc for hours on
end when there are far more exciting things on offer .... (only joking!)
Richard Spencer phy7rs@leeds.ac.uk (until May 2001)
Mortain House
Bodington Hall
Otley Road
LEEDS
LS16 5PT
(until June 1998)
RECENT CHANGES
Version Stuff Done
1.50 04 Nov 97 Option to hide icon bar icon (for Clive Semmens)
1.55 08 Nov 97 Sleep and no-sleep corners added (thanx Reg French)
Config window changed (improved hopefully)
1.60 26 Feb 98 Screensaver ends when message &4DEC0 broadcast which is when
!CallerID sees an incoming call (John and Christina West)
Alt-Quit closes all currenly loaded copies
!RunImage sets its own slot size so Filer_Run can be used
In first line M%=max number of lines, m%=message id
1.61 20 Mar 98 Attempted to cure missed typed characters when used in
combination with Mauser. Uses Wimp_PollIdle p%=delay in cs
Future - rewrite the entire program to create relocatable module in the same
way the screensaver 'Out to Lunch' does...... ?